package cn.sjxy.ssm.controller;

import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import cn.sjxy.ssm.domain.Department;
import cn.sjxy.ssm.service.DepartmentService;
@Controller
public class DepartmentController {
    @Autowired
    private DepartmentService deptService;
	public DepartmentService getDeptService() {
		return deptService;
	}
	public void setDeptService(DepartmentService deptService) {
		this.deptService = deptService;
	}
	/**
	 * 功能：查询所有的部门信息，并在WEB-INF/jsp/dept/shows.jsp页面显示
	 * @param map
	 * @return
	 */
	@RequestMapping(value="/dept",method = RequestMethod.GET)
	public String getDepts(Map<String,Object> map) {
		List<Department> list=deptService.findAllDepts();
		map.put("depts", list);
		return "dept/shows";
	}
}
